how to implement linear search in C